import logging

from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from flask import session, current_app

from info import create_app, db, models

# manage.py 是程序启动的入口,只关心启动的相关参数以及内容
# 不关心具体该如何创建app或者相关业务逻辑


# 通过指定的配置名字创建对应配置的app
app = create_app('development')


# 数据库迁移扩展
manager = Manager(app)
Migrate(app, db)
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()